<template>
	<!-- <view class="promote"> -->
		<image class="bg" :src="newsBox.code"></image>
		<!-- <view class="newsBox"> -->
			<!-- <image class="code" :src="newsBox.code"></image>
			<text class="icode">{{newsBox.icode}}</text> -->
		<!-- </view> -->
	<!-- </view> -->
</template>

<script>
	export default {
		data() {
			return {
				newsBox:{}
			}
		},
		onLoad() {
			this.getNews()
		},
		methods: {
			getNews() {
				let that = this;
				that.$Request.post(that.$api.discount.getMyCode).then(res => {
					console.log('获取邀请码信息',res)
					that.$set(that.newsBox, 'code', res.data.code[0])
					that.$set(that.newsBox, 'icode', res.data.icode)
				},err => {
					uni.navigateTo({
						url: '/pages/login/login'
					});
					console.log("err: " + JSON.stringify(err));
				});
			},
		}
	}
</script>

<style lang='scss'>
	page {
		background-color: #f7f7f7;
		padding-bottom: 30upx;
		padding: 0;
	}
	.promote{
		width: 100vw;
		height: 100vh;
			display: flex;
			align-items: center;
			justify-content: center;
			flex-direction: column;
			.code{
				width: 36vw;
				height: 36vw;
				margin-bottom: 6vh;
			}
	}
	.bg{
		position: absolute;
		top: 0;
		left: 0;
		z-index: -1;
		width: 100vw;
		height: 100vh;
	}
	
</style>
